package com.gorkr.bio.thread_pool;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author gorkr
 * @date 2022/05/31 00:28
 **/
public class Server {
    public static void main(String[] args) {
        try {
            ServerSocket ss = new ServerSocket(9999);
            HandlerSocketServerPool pool = new HandlerSocketServerPool(4, 2);
            while (true){
                Socket accept = ss.accept();
                pool.execute(new ServerRunnableTarget(accept));
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
    